﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Jarvis.Learners.DecisionTree;

namespace Jarvis.Learners
{
    class LearnerTester
    {
        public LearnerTester()
        {
            C45DecisionTreeLearner learner = new C45DecisionTreeLearner();
            learner.name = "Test";

            Dictionary<String, Object> state = new Dictionary<string,object>();
            state["outlook"] = "s";
            state["temp"] = (Double) 75;
            state["humid"] = (Double) 70;
            state["windy"] = "t";
            learner.AddExampleForClass(state, "p");

            state = new Dictionary<string, object>();
            state["outlook"] = "s";
            state["temp"] = (Double) 80;
            state["humid"] = (Double) 90;
            state["windy"] = "t";
            learner.AddExampleForClass(state, "d");

            state = new Dictionary<string, object>();
            state["outlook"] = "s";
            state["temp"] = (Double)85;
            state["humid"] = (Double)85;
            state["windy"] = "f";
            learner.AddExampleForClass(state, "d");

            state = new Dictionary<string, object>();
            state["outlook"] = "s";
            state["temp"] = (Double)72;
            state["humid"] = (Double)95;
            state["windy"] = "f";
            learner.AddExampleForClass(state, "d");

            state = new Dictionary<string, object>();
            state["outlook"] = "s";
            state["temp"] = (Double)69;
            state["humid"] = (Double)70;
            state["windy"] = "f";
            learner.AddExampleForClass(state, "p");

            state = new Dictionary<string, object>();
            state["outlook"] = "o";
            state["temp"] = (Double)72;
            state["humid"] = (Double)90;
            state["windy"] = "t";
            learner.AddExampleForClass(state, "p");

            state = new Dictionary<string, object>();
            state["outlook"] = "o";
            state["temp"] = (Double)83;
            state["humid"] = (Double)78;
            state["windy"] = "f";
            learner.AddExampleForClass(state, "p");

            state = new Dictionary<string, object>();
            state["outlook"] = "o";
            state["temp"] = (Double)64;
            state["humid"] = (Double)65;
            state["windy"] = "t";
            learner.AddExampleForClass(state, "p");

            state = new Dictionary<string, object>();
            state["outlook"] = "o";
            state["temp"] = (Double)81;
            state["humid"] = (Double)75;
            state["windy"] = "f";
            learner.AddExampleForClass(state, "p");

            state = new Dictionary<string, object>();
            state["outlook"] = "r";
            state["temp"] = (Double)71;
            state["humid"] = (Double)80;
            state["windy"] = "t";
            learner.AddExampleForClass(state, "d");

            state = new Dictionary<string, object>();
            state["outlook"] = "r";
            state["temp"] = (Double)65;
            state["humid"] = (Double)70;
            state["windy"] = "t";
            learner.AddExampleForClass(state, "d");

            state = new Dictionary<string, object>();
            state["outlook"] = "r";
            state["temp"] = (Double)75;
            state["humid"] = (Double)80;
            state["windy"] = "f";
            learner.AddExampleForClass(state, "p");

            state = new Dictionary<string, object>();
            state["outlook"] = "r";
            state["temp"] = (Double)68;
            state["humid"] = (Double)80;
            state["windy"] = "f";
            learner.AddExampleForClass(state, "p");

            state = new Dictionary<string, object>();
            state["outlook"] = "r";
            state["temp"] = (Double)70;
            state["humid"] = (Double)96;
            state["windy"] = "f";
            learner.AddExampleForClass(state, "p");

            learner.Train();

        }
    }
}
